package com.jack.module.jetpack.datastore.proto

import androidx.datastore.Serializer
import com.jack.module.jetpack.datastore.UserInfoProto
import java.io.InputStream
import java.io.OutputStream

/**
 * @author: dingfeng
 * @date: 2020-10-29
 * @since: 1.0.0
 **/
object UserInfoSerializer : Serializer<UserInfoProto> {
    override fun readFrom(input: InputStream): UserInfoProto {
        return UserInfoProto.parseFrom(input)
    }

    override fun writeTo(t: UserInfoProto, output: OutputStream) = t.writeTo(output)
}
